#pragma once

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <uv.h>
#include "log/log.h"
#include "version.h"

typedef struct
{
    struct
    {
        char log_dir[100];
        int max_files;
    } log;

    struct
    {
        char addr[100];
        char whois[100];
        char sub[10][100]; // 假设最多有10个订阅主题
        size_t sub_count;
    } mqtt;

    struct
    {
        char mb_ip[100];
        int mb_port;
    } modbus;

    struct
    {
        int fb_wait;
        int oil_wait;
        int main_wait;
    } ctrl;

} dev_cfg_t;

typedef struct
{
    uv_loop_t *loop;
    dev_cfg_t cfg;
    uv_async_t async_mqtt;
} sys_ctrl_t;
